<ion-header-bar align-title="center" class="bar-positive">
  <div class="buttons">
    <button ng-click="$ionicGoBack()"
            class="button back-button no-animation button-icon icon buttons button-clear ion-ios-arrow-back">
    </button>
  </div>
  <h1 class="title">密码设置</h1>
</ion-header-bar>
<ion-view>
  <ion-content class="has-header" style="background: #f5f5f5" ng-controller="registerCtrl">
    <form name="signupform">
      <ul class="aui-list aui-form-list" style="padding-top: 28px">
        <li class="aui-list-item">
          <div class="aui-list-item-inner">
            <div class="aui-list-item-label">
              新密码
            </div>
            <div class="aui-list-item-input">
              <input type="password" name="password" ng-model="userdata.password" ng-minlength="6" required>
            </div>
          </div>
        </li>
        <p class="error" ng-if="signupform.password.$error.required&&signupform.password.$touched">
          密码不可为空！
        </p>
        <p class="error" ng-if="signupform.password.$error.minlength&&signupform.password.$touched">
          密码长度不得少于6位！
        </p>
        <li class="aui-list-item">
          <div class="aui-list-item-inner">
            <div class="aui-list-item-label">
              确认密码
            </div>
            <div class="aui-list-item-input">
              <input type="text" name="password2" compare="userdata.password" ng-model="userdata.password2" required>
            </div>
          </div>
        </li>
        <p class="error" ng-if="signupform.password2.$error.compare && signupform.password2.$touched">
          两次输入密码不一致！
        </p>
        <!--<pre>password合法：{{signupform.password.$valid}}</pre>
        <pre>password2合法：{{signupform.password2.$valid}}</pre>-->
      </ul>
      <div class="item" style="border:none;background: #f5f5f5">
        <button ng-submit="login()" style="border-radius: initial;background: #23A6D8"
                class="button button-block button-positive" type="button">确定
        </button>
      </div>
      </div>
    </form>
  </ion-content>
</ion-view>
